import time
from selenium import webdriver
import unittest


class VisitPTPress(unittest.TestCase):

	def setUp(self):
		self.driver = webdriver.Firefox()

	def tearDown(self):
		self.driver.quit()

	def test_open_ptpress(self):
		self.driver.get("https://www.baidu.com")  # 打开百度
		self.assertIn('百度一下', self.driver.page_source)  # 断言：网页中有“图书”字样。
		print('assertIn断言结果：',self.assertIn('百度一下', self.driver.page_source))
		print('self.driver.title:',self.driver.title)
		print("今天最后一次测试")


if __name__ == '__main__':
	unittest.main()
